﻿<%@ Page Language="C#" MasterPageFile="~/webUI/user/userTemplate.master" AutoEventWireup="true"
    CodeFile="insert_THIO_Wizard.aspx.cs" Inherits="insert_THIO_Wizard" Title=".::E-Valuation System::.." %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="UIDivInfo">
        <div class="UITabPane" style="margin-top: 15px;">
            <div class="TabPaneContent">
                <div class="WorkingAreaWithHelp" style="width: 98.5%;">
                    <div class="UIHorizontalTabs">
                        <div class="LeftHorizontalTabs">
                            <div class="RightHorizontalTabs">
                                <div class="CenterHorizontalTabs">
                                    <div class="TabsContainer">
                                        <asp:PlaceHolder ID="TabsContainer" runat="server">
                                            <div class="UITab NormalTabStyle">
                                                <% String className = "NormalTab";
                                                   if (getSelectedTab().Equals("0"))
                                                   {
                                                       className = "SelectedTab";
                                                   }
                                                %>
                                                <div id="UITab0" class="<%=className %>">
                                                    <div class="LeftTab">
                                                        <div class="RightTab">
                                                            <div class="MiddleTab">
                                                                <asp:LinkButton CssClass="NormalLink" ID="TabValue0" runat="server" CausesValidation="false"
                                                                    OnClick="ChangeTabIndex">
                                                                  Bắt đầu
                                                                </asp:LinkButton>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="UITab NormalTabStyle">
                                                <%
                                                    className = "NormalTab";
                                                    if (getSelectedTab().Equals("1"))
                                                    {
                                                        className = "SelectedTab";
                                                    }
                                                %>
                                                <div id="UITab1" class="<%=className %>">
                                                    <div class="LeftTab">
                                                        <div class="RightTab">
                                                            <div class="MiddleTab">
                                                                <asp:LinkButton CssClass="NormalLink" ID="TabValue1" runat="server" CausesValidation="false"
                                                                    OnClick="ChangeTabIndex">
                                                                Alpha T
                                                                </asp:LinkButton>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="UITab NormalTabStyle">
                                                <%
                                                    className = "NormalTab";
                                                    if (getSelectedTab().Equals("2"))
                                                    {
                                                        className = "SelectedTab";
                                                    }
                                                %>
                                                <div id="UITab2" class="<%=className %>">
                                                    <div class="LeftTab">
                                                        <div class="RightTab">
                                                            <div class="MiddleTab">
                                                                <asp:LinkButton CssClass="NormalLink" ID="TabValue2" runat="server" CausesValidation="false"
                                                                    OnClick="ChangeTabIndex">
                                                                  Alpha H
                                                                </asp:LinkButton>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="UITab NormalTabStyle">
                                                <%
                                                    className = "NormalTab";
                                                    if (getSelectedTab().Equals("3"))
                                                    {
                                                        className = "SelectedTab";
                                                    }
                                                %>
                                                <div id="UITab3" class="<%=className %>">
                                                    <div class="LeftTab">
                                                        <div class="RightTab">
                                                            <div class="MiddleTab">
                                                                <asp:LinkButton CssClass="NormalLink" ID="TabValue3" runat="server" CausesValidation="false"
                                                                    OnClick="ChangeTabIndex">
                                                                  Alpha I
                                                                </asp:LinkButton>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="UITab NormalTabStyle">
                                                <%
                                                    className = "NormalTab";
                                                    if (getSelectedTab().Equals("4"))
                                                    {
                                                        className = "SelectedTab";
                                                    }
                                                %>
                                                <div id="UITab4" class="<%=className %>">
                                                    <div class="LeftTab">
                                                        <div class="RightTab">
                                                            <div class="MiddleTab">
                                                                <asp:LinkButton CssClass="NormalLink" ID="TabValue4" runat="server" CausesValidation="false"
                                                                    OnClick="ChangeTabIndex">
                                                                  Alpha O
                                                                </asp:LinkButton>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="UITab NormalTabStyle">
                                                <%
                                                    className = "NormalTab";
                                                    if (getSelectedTab().Equals("5"))
                                                    {
                                                        className = "SelectedTab";
                                                    }
                                                %>
                                                <div id="UITab5" class="<%=className %>">
                                                    <div class="LeftTab">
                                                        <div class="RightTab">
                                                            <div class="MiddleTab">
                                                                <asp:LinkButton CssClass="NormalLink" ID="TabValue5" runat="server" CausesValidation="false"
                                                                    OnClick="ChangeTabIndex">
                                                                 Kết thúc
                                                                </asp:LinkButton>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </asp:PlaceHolder>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div style="clear: left;">
                        <span></span>
                    </div>
                    <asp:PlaceHolder ID="UITabContentContainer" runat="server">
                        <div class="UITabContentContainer">
                            <div class="THIO_Wizard">
                                <%
                                    String styleDisplay = "none";
                                    if (getSelectedTab().Equals("0"))
                                    {
                                        styleDisplay = "block";
                                    }
                                %>
                                <div id="UITabContent0" class="UITabContent" style="display: <%=styleDisplay %>">
                                    <asp:Panel ID="Panel6" runat="server">
                                        <label>
                                            Trước khi nhập điểm bạn phải chọn một số mục</label>
                                        <div class="FeildContainer">
                                            <label>
                                                Chọn hội đồng</label>
                                            <asp:DropDownList CssClass="Select" runat="server" DataSourceID="hoidongData" ID="cb_hoidong"
                                                DataTextField="TenHoidong" DataValueField="MaHoidong" AutoPostBack="true" OnSelectedIndexChanged="changeCucil">
                                            </asp:DropDownList>
                                            <asp:SqlDataSource runat="server" ID="hoidongData" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                                                SelectCommand="SELECT [MaHoidong], [TenHoidong] FROM [hoidong] where madoanhnghiep=@madoanhnghiep union select 0, N'----Chọn một----'">
                                                <SelectParameters>
                                                    <asp:SessionParameter SessionField="companyId" Name="madoanhnghiep" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                        </div>
                                        <div class="FeildContainer">
                                            <label>
                                                Chọn sản phẩm</label>
                                            <asp:DropDownList CssClass="Select" runat="server" ID="cb_sanpham" DataSourceID="sanphamData"
                                                DataTextField="TenSanPham" DataValueField="MaSanPham">
                                            </asp:DropDownList>
                                            <asp:SqlDataSource runat="server" ID="sanphamData" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                                                SelectCommand="SELECT [MaSanPham], [TenSanPham] FROM [SanPham] where mahoidong=@mahoidong and madoanhnghiep=@madoanhnghiep and status =1">
                                                <SelectParameters>
                                                    <asp:ControlParameter Name="mahoidong" ControlID="cb_hoidong" PropertyName="SelectedValue" />
                                                    <asp:SessionParameter Name="madoanhnghiep" SessionField="companyId" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                        </div>
                                    </asp:Panel>
                                </div>
                                <%
                                    styleDisplay = "none";
                                    if (getSelectedTab().Equals("1"))
                                    {
                                        styleDisplay = "block";
                                    }
                                %>
                                <div id="UITabContent1" class="UITabContent" style="display: <%=styleDisplay %>">
                                    <asp:Panel runat="server" ID="CapPhepPanle" >
                                        <label>
                                            Nhập alpha T</label>
                                        <div class="FeildContainer">
                                            <asp:Repeater ID="rp_alphaT" runat="server" DataSourceID="alphaTData">
                                                <ItemTemplate>
                                                    <div class="FeildContainer">
                                                        <asp:Label ID="Label2" CssClass="Label" runat="server" Text='<%#Eval("tenbuocgiacong")%>'></asp:Label>
                                                        <asp:TextBox ID="TextBox2" runat="server" CssClass="Textbox" Text='<%#Eval("alphat")%>'></asp:TextBox>
                                                        <asp:HiddenField runat="server" Value='<%#Eval("mabuocgiacong") %>' />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                            <asp:SqlDataSource runat="server" ID="alphaTData" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                                                SelectCommand="select * from buocgiacong where  masanpham=@productId">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="cb_sanpham" Name="productId" PropertyName="SelectedValue" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                        </div>
                                    </asp:Panel>
                                </div>
                                <%
                                    styleDisplay = "none";
                                    if (getSelectedTab().Equals("2"))
                                    {
                                        styleDisplay = "block";
                                    }
                                %>
                                <div id="UITabContent2" class="UITabContent" style="display: <%=styleDisplay %>;">
                                    <asp:Panel ID="Panel7" runat="server">
                                        <label>
                                            Nhập alpha H</label>
                                        <div class="FeildContainer">
                                            <asp:Repeater ID="rp_alphaH" runat="server" DataSourceID="alphaHData">
                                                <ItemTemplate>
                                                    <div class="FeildContainer">
                                                        <asp:Label ID="Label1" CssClass="Label" runat="server" Text='<%#Eval("tennhantoconnguoi")%>'></asp:Label>
                                                        <asp:TextBox ID="TextBox1" CssClass="Textbox" runat="server" Text='<%#Eval("alphah")%>'></asp:TextBox>
                                                        <asp:HiddenField   runat="server" Value='<%#Eval("manhantoconnguoi") %>' />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                            <asp:SqlDataSource runat="server" ID="alphaHData" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                                                SelectCommand="select * from nhantoconnguoi where masanpham=@productId">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="cb_sanpham" Name="productId" PropertyName="SelectedValue" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                        </div>
                                    </asp:Panel>
                                </div>
                                <%
                                    styleDisplay = "none";
                                    if (getSelectedTab().Equals("3"))
                                    {
                                        styleDisplay = "block";
                                    }
                                %>
                                <div id="UITabContent3" class="UITabContent" style="display: <%=styleDisplay %>;">
                                    <asp:Panel ID="Panel1" runat="server">
                                        <label>
                                            Nhập alpha I</label>
                                        <div class="FeildContainer">
                                            <asp:Repeater ID="rp_alphaI" runat="server" DataSourceID="alphaIData">
                                                <ItemTemplate>
                                                    <div class="FeildContainer">
                                                        <asp:Label ID="Label1" CssClass="Label" runat="server" Text='<%#Eval("tenchitietthongtin")%>'></asp:Label>
                                                        <asp:TextBox ID="TextBox1" CssClass="Textbox" runat="server" Text='<%#Eval("alphai")%>'></asp:TextBox>
                                                        <asp:HiddenField    runat="server" Value='<%#Eval("machitietthongtin") %>' />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                            <asp:SqlDataSource runat="server" ID="alphaIData" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                                                SelectCommand="select * from chitietthongtin where masanpham = @productId">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="cb_sanpham" Name="productId" PropertyName="SelectedValue" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                        </div>
                                    </asp:Panel>
                                </div>
                                <%
                                    styleDisplay = "none";
                                    if (getSelectedTab().Equals("4"))
                                    {
                                        styleDisplay = "block";
                                    }
                                %>
                                <div id="UITabContent4" class="UITabContent" style="display: <%=styleDisplay %>;">
                                    <asp:Panel ID="Panel2" runat="server">
                                        <label>
                                            Nhập alpha O</label>
                                        <div class="FeildContainer">
                                            <asp:Repeater ID="rp_alphaO" runat="server" DataSourceID="alphaOData">
                                                <ItemTemplate>
                                                    <div class="FeildContainer">
                                                        <asp:Label ID="Label1" CssClass="Label" runat="server" Text='<%#Eval("tenchitiettochuc")%>'></asp:Label>
                                                        <asp:TextBox ID="TextBox1" CssClass="Textbox" runat="server" Text='<%#Eval("alphao")%>'></asp:TextBox>
                                                        <asp:HiddenField ID="HiddenField1"    runat="server" Value='<%#Eval("machitiettochuc") %>' />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                            <asp:SqlDataSource runat="server" ID="alphaOData" ConnectionString="<%$ ConnectionStrings:evaConn %>"
                                                SelectCommand="select * from chitiettochuc where masanpham = @productId">
                                                <SelectParameters>
                                                    <asp:ControlParameter ControlID="cb_sanpham" Name="productId" PropertyName="SelectedValue" />
                                                </SelectParameters>
                                            </asp:SqlDataSource>
                                        </div>
                                    </asp:Panel>
                                </div>
                                <%
                                    styleDisplay = "none";
                                    if (getSelectedTab().Equals("5"))
                                    {
                                        styleDisplay = "block";
                                    }
                                %>
                                <div id="UITabContent5" class="UITabContent" style="display: <%=styleDisplay %>;">
                                    <asp:Panel ID="Panel3" runat="server">
                                        <label>
                                            Kết thúc</label>
                                            <div class="FeildContainer">
                                                <label>Chỉ tiêu T: </label>
                                                <label class="LabelLeft"><%=rp_alphaT.Controls.Count %></label>
                                            </div>
                                            <div class="FeildContainer">
                                                <label>Chỉ tiêu H: </label>
                                                <label class="LabelLeft"><%=rp_alphaH.Controls.Count %></label>
                                            </div>
                                            <div class="FeildContainer">
                                                <label>Chỉ tiêu I: </label>
                                                <label class="LabelLeft"><%=rp_alphaI.Controls.Count %></label>
                                            </div>
                                            <div class="FeildContainer">
                                                <label>Chỉ tiêu O: </label>
                                                <label class="LabelLeft"><%=rp_alphaO.Controls.Count %></label>
                                            </div>
                                           
                                    </asp:Panel>
                                </div>
                            </div>
                        </div>
                    </asp:PlaceHolder>
                </div>
            </div>
        </div>
    </div>
    <div class="ActionButtons">
    <%if( getSelectedTab() != "0" ) { %>
        <asp:Button runat="server" ID="btn_back" Text="Quay lại" OnClick="backStep" />
     <%} %>
     <%if( getSelectedTab() != "5" ) { %>
        <asp:Button runat="server" ID="btn_next" Text="Tiếp" OnClick="nextStep" />
         
      <%} %>
        <asp:Button runat="server" ID="btn_reset" Text="Nạp lại" OnClick="resetValue" />
        <asp:Button runat="server" ID="btn_finish" Text="Kết thúc" OnClick="saveWizard" />
        <asp:Button runat="server" ID="btn_cancel" Text="Bỏ qua" OnClick="cancelWizard" />
    </div>
</asp:Content>
